import { createApp } from 'vue';
import App from './App.vue';
//使用Pinia
import pinia from '@/pinia/index';
import router from './router';
import store from './store';
import ElementPlus from 'element-plus';

import storage from './utils/storage.js';
import api from './api/api.js';
//自定义组件
import batchImport from '@/components/com/index';
//emelent 图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

import zhCn from 'element-plus/dist/locale/zh-cn.mjs';

// 表单设计器
import ElementUI from 'element-plus/es/index';
import 'element-ui/lib/theme-chalk/index.css';
import 'element-plus/dist/index.css';
import formCreate from '@form-create/element-ui';
import FcDesigner from '@form-create/designer';
//格式化工具编辑器
import Editor from 'bin-editor-next';
//移动适配
import './utils/rem';

//引入 iconfont
// import SvgIcon from './components/com/SvgIcon.vue
// import './assets/icon/iconfont.js';
const app = createApp(App);
// app.component('svg-icon', SvgIcon);
app.config.globalProperties.$api = api;
app.config.globalProperties.$storage = storage;
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(ElementPlus, {
  locale: zhCn,
});
app.component(Editor.name, Editor);

app.use(store);
app.use(router);
app.use(ElementPlus);
app.use(ElementUI);
app.use(formCreate);
app.use(FcDesigner);
app.use(batchImport);
app.use(pinia);
app.use(ElementPlus, { size: 'small', zIndex: 3000 });
app.mount('#app');
